﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VSSAHT
{
    public class ParaPort
    {

        #region Port Name
        /// <summary>
        /// PortName = "COM1"
        /// </summary>
        public string PortName
        {
            get { return VSS_AHT.Properties.Settings.Default.PortName; }
            set
            {
                if (VSS_AHT.Properties.Settings.Default.PortName != value)
                {
                    VSS_AHT.Properties.Settings.Default.PortName = value;
                }
            }
        } 
        #endregion

        #region Baud Rate
        /// <summary>
        /// BaudRate = 2400
        /// </summary>
        public int BaudRate
        {
            get { return VSS_AHT.Properties.Settings.Default.BaudRate; }
            set
            {
                if (VSS_AHT.Properties.Settings.Default.BaudRate != value)
                {
                    VSS_AHT.Properties.Settings.Default.BaudRate = value;
                }
            }
        } 
        #endregion

        #region Parity
        /// <summary>
        /// Parity = 2
        /// </summary>
        public int Parity
        {
            get { return VSS_AHT.Properties.Settings.Default.Parity; }
            set
            {
                if (VSS_AHT.Properties.Settings.Default.Parity != value)
                {
                    VSS_AHT.Properties.Settings.Default.Parity = value;
                }
            }
        } 
        #endregion

        #region Data Bits
        /// <summary>
        /// DataBits
        /// </summary>
        public int DataBits
        {
            get { return VSS_AHT.Properties.Settings.Default.DataBits; }
            set
            {
                if (VSS_AHT.Properties.Settings.Default.DataBits != value)
                {
                    VSS_AHT.Properties.Settings.Default.DataBits = value;
                }
            }
        } 
        #endregion

        #region Stop Bits
        /// <summary>
        /// StopBits
        /// </summary>
        public int StopBits
        {
            get { return VSS_AHT.Properties.Settings.Default.StopBits; }
            set
            {
                if (VSS_AHT.Properties.Settings.Default.StopBits != value)
                {
                    VSS_AHT.Properties.Settings.Default.StopBits = value;
                }
            }
        }

#endregion

        #region config Receive Byte
        
        public byte StartByte
        {
            get { return VSS_AHT.Properties.Settings.Default.StartByte; }
            set {
                if (VSS_AHT.Properties.Settings.Default.StartByte != value)
                {
                    VSS_AHT.Properties.Settings.Default.StartByte = value;
                }
            }
        }
        public byte EndByte
        {
            get { return VSS_AHT.Properties.Settings.Default.EndByte; }
            set
            {
                if (VSS_AHT.Properties.Settings.Default.EndByte != value)
                {
                    VSS_AHT.Properties.Settings.Default.EndByte = value;
                }
            }
        }
        public int SkipBytes
        {
            get { return VSS_AHT.Properties.Settings.Default.SkipBytes; }
            set
            {
                if (VSS_AHT.Properties.Settings.Default.SkipBytes != value)
                {
                    VSS_AHT.Properties.Settings.Default.SkipBytes = value;
                }
            }
        }
        #endregion

        #region storagePath

        public string storagePath
        {
            get { return VSS_AHT.Properties.Settings.Default.storagePath; }
            set 
            {
                if (VSS_AHT.Properties.Settings.Default.storagePath != value)
                {
                    VSS_AHT.Properties.Settings.Default.storagePath = value;
                }
            }
        }
        #endregion

    }
}
